hidpi_scale_at_192
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Fri, 16 Feb 2018 18:36:32 +0000 (18:36 +0000)
committerLisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>
Fri, 16 Feb 2018 18:36:32 +0000 (18:36 +0000)
Gbp-Pq: Name hidpi_scale_at_192.diff

src/plugins/platforms/xcb/qxcbscreen.cpp

index 5e136b5d7e516ef9bec6258b11c3bd63968e99d4..0ad28429c8d0ea54266b81d8d40e8c79fac69cf3 100644 (file)
@@ -620,7 +620,7 @@ void QXcbScreen::updateGeometry(const QRect &geom, uint8_t rotation)
         m_sizeMillimeters = sizeInMillimeters(xGeometry.size(), virtualDpi());
 
     qreal dpi = xGeometry.width() / physicalSize().width() * qreal(25.4);
-    m_pixelDensity = qMax(1, qRound(dpi/96));
+    m_pixelDensity = qMax(1, (int) (dpi/96)); // instead of rounding at 1.5, round at 2.0 (same as GNOME)
     m_geometry = QRect(xGeometry.topLeft(), xGeometry.size());
     m_availableGeometry = xGeometry & m_virtualDesktop->workArea();
     QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), m_geometry, m_availableGeometry);